package com.youyun56.gps.android.events;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.TextView;

import com.youyun56.gps.android.GoodInfoActivity;
import com.youyun56.gps.android.GpsActivity;
import com.youyun56.gps.android.R;

public class GoodInfoMenuItemClick extends BaseMenuItemClick implements OnItemClickListener {
    private final static String tag = GoodInfoMenuItemClick.class.getName();
    private GoodInfoActivity main;

    public GoodInfoMenuItemClick(GoodInfoActivity main) {
        this.main = main;
    }

    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int item, long log) {

        TextView txt = (TextView) view.findViewById(R.id.item_text);
        if (txt.getText().equals(main.getResources().getString(R.string.sys_out))) {
            goActivity(main, GpsActivity.class);
            return;
        }
        main.getMenuDialog().dismiss();
    }

}
